import {GenerateParam} from "./GenerateParam";
import {Constant} from "./Constant";
export class UserModel implements GenerateParam {
    private _username: string;
    private _password: string;
    private _phone: string;
    private _implement: string = Constant.generate_param_label;

    get username(): string {
        return this._username;
    }

    set username(value: string) {
        this._username = value;
    }

    get password(): string {
        return this._password;
    }

    set password(value: string) {
        this._password = value;
    }

    get phone(): string {
        return this._phone;
    }

    set phone(value: string) {
        this._phone = value;
    }

    get implement(): string {
        return this._implement;
    }

    set implement(value: string) {
        this._implement = value;
    }

    public generateParam(): string {
        let username: string = this.username ? this.username : "",
            password: string = this.password ? this.password : "",
            phone: string = this.phone ? this.phone : "";
        return `username=${username}&password=${password}&phone=${phone}`;
    }
}
